#ifndef _BIT_FLAG_H_
#define _BIT_FLAG_H_

#include "../bit/bit.h"

/*
	class : BitFlag
	desc : This is similar to bit pointer except that it is fully volatile.
		This class should only be used for creating references to flags
		This is a simple easy access for cases where I really actual
		do need to use a volatile variable. You should use this
		to help completely reduce your use of all volatile variables in
		your code.
*/
class BitFlag
{
	private:
		//pointer to the data which I want to look at. doesn't
		//need to be volatile
		volatile unsigned char* pointer;
		//the number of bit I want to look at. 
		unsigned char bitNumber;//the number of bit

	public:
		//nots the bit of the bit pointer
		void notBit() volatile;

		//default constructor
		BitFlag();
		//constructor sets pointer, and bit number
		BitFlag(volatile unsigned char* pointer, unsigned char number);
		//sets pointer and bit number.
		BitFlag(unsigned char* pointer, unsigned char number);
		//sets the bit to 1 or 0.
		void setBit(unsigned char value) volatile; 
		//grabs the value of the bit pointed to 
		unsigned char getBit() volatile;
		//will return either 1 or 0.

		//assignment operator
		BitFlag& operator=(const BitFlag& f) volatile;



};


#endif 

